<?
if(! defined('BASEPATH') ){ exit('Unable to view file.'); }
if(isset($_POST['submit'])){
	$name = $db->EscapeString($_POST['name']);
	$days = $db->EscapeString($_POST['days']);
	$price = $db->EscapeString($_POST['price']);
	
	if($name != '' && $coins > 0 && $price > 0){
		$db->Query("INSERT INTO `p_pack` (name, days, price) VALUES('".$name."', '".$days."', '".$price."')");
		$mesaj = '<div class="message success"><h3>Success!</h3><p>VIP pack successfuly added!</p></div>';
	}else{
		$mesaj = '<div class="message error"><h3>Error!</h3><p>Please check if you completed all fields!</p></div>';
	}
}
?>
            <div id="page-subheader">
                <div class="wrapper clearfix">
                    <nav id="sub-nav">
                        <ul>
                            <li><a href="index.php?x=p_packs">Packs</a></li>
                            <li class="active"><a href="index.php?x=addpackp">Add</a></li>
                        </ul>
                    </nav>
                </div>
            </div>
        </header>
        
        <section id="content">
            <div class="wrapper">
                <section class="grid_6 first top">
                    <div class="columns leading">
                        <div class="grid_6 first"><? echo $mesaj;?>
						<form id="form" method="post" class="form widget">
                                <header><h2>Add VIP Pack</h2></header>
                                <section>                 
                                    <fieldset>
                                         <dl>
                                             <dt></dt><dd><label>Name</label><input type="text" name="name" value="" required="required" /></dd>
											 <dt></dt><dd><label>Days</label><input type="text" name="days" value="0" required="required" /></dd>
                                             <dt></dt><dd><label>Price</label><input type="text" name="price" value="0.00" required="required" /></dd>
                                     	</dl>    
                                     </fieldset>
                                     <hr />
                                     <button class="button button-green" type="submit" name="submit">Add</button>
                                     <button class="button button-gray" type="reset">Reset</button>
                                </section>
                            </form>
                        </div>
                    </div>


                    <div class="clear">&nbsp;</div>

                </section>

                <aside class="grid_2 top">
                    <div class="accordion">
                        <header class="current"><h2>Info</h2></header>
                        <section style="display:block">
                            Here you can add VIP packs!
                        </section>
                    </div>
                </aside>

                <div class="clear"></div>
            </div>
            <div id="push"></div>
        </section>
    </div>
    
    <footer id="page-footer">
        <div id="footer-inner">
            <p class="wrapper">All rights reserved &copy; <a href="http://mafianet.org" target="_blank">MafiaNet</a> <?=date('Y')?></p>
        </div>
    </footer>
</body>
</html>